package matrix_operations;

public class LInftyNorm implements Norm {
	
	private Matrix M;
	
	public LInftyNorm(Matrix M) {
		
		this.M = M;
	}

	public double value() {
		
		double norm = 0;
		double sum = 0;
		for (int i = 0; i < M.getM(); i++) {
			for (int j = 0; i < M.getN(); j++) {
				sum += Math.abs(M.getValue(i, j));
			}
			if (sum > norm)
				norm = sum;
		}
		return norm;
	}
}
